//
//  WechatManager.h
//  CCQMEnglish
//
//  Created by Roger on 2019/9/30.
//  Copyright © 2019 Roger. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "WXApi.h"

@interface WechatPayModel : NSObject

/** 商家向财付通申请的商家id */
@property (nonatomic, copy) NSString *partnerId;
/** 预支付订单 */
@property (nonatomic, copy) NSString *prepayId;
/** 随机串，防重发 */
@property (nonatomic, copy) NSString *nonceStr;
/** 时间戳，防重发 */
@property (nonatomic, assign) UInt32 timeStamp;
/** 商家根据财付通文档填写的数据和签名 */
@property (nonatomic, copy) NSString *package;
/** 商家根据微信开放平台文档对数据做的签名 */
@property (nonatomic, copy) NSString *sign;

@end


@interface WechatManager : NSObject
+ (WechatManager *)defaultManager;
/*
 * 获取微信授权后 用户信息 方可使用
 */
@property (nonatomic,strong)NSDictionary * weiXinIfon;
+ (WechatManager *)defaultManager;
/*
 * 获取微信授权后 用户信息 方可使用
 */
@property (nonatomic,strong)NSDictionary * weiXinIfon;
/*! @brief 检查微信是否已被用户安装
*
* @return 微信已安装返回YES，未安装返回NO。
*/
-(BOOL)isWX;
//注册微信sdk
-(void)wechatRegisterApp;
//授权唤醒Wexin
-(void)sendAuthRequest;
//获取微信授权Code回调
-(void)sendAuthRequestComplete:(void (^)(NSString * wechatCode))complete;
//获取微信授权返回用户信息
-(void)openWeChatIdComplete:(void (^)(NSDictionary * wechatUserInfo))complete;
//反回掉代理设置
-(BOOL)new_handleOpenURL:(NSURL *)url;
-(BOOL)new_handleOpenUniversalLink:(NSUserActivity *)userActivity;

#pragma mark - 分享链接到微信
-(void)shareWeChatLink:(NSString *)url description:(NSString *)description title:(NSString *)title image:(UIImage *)image Scene:(int)scene;
//制定跳转微信小程序
-(void)open_WXMiniPath:(NSString *)path userName:(NSString *)userName;
#pragma mark - 打开微信网页
-(void)open_WechatWebWithUrl:(NSString *)url;
#pragma mark - 打开微信
-(void)open_Wechat;
#pragma mark - 微信支付
-(void)wechat_pay:(WechatPayModel *)model;
-(void)wechat_pay:(WechatPayModel *)model
         complete:(void (^)(PayResp *model))complete
           failed:(void (^)(PayResp *model))failed;
//=============== 私有方法 ==============
//商户端小程序id
-(void)open_WXMiniShopId:(NSString *)shopId;
//跳到微信小程序
-(void)open_WXMiniRegBusiness;
//跳到 微信公众号
-(void)open_WXBizProfileRegBusiness;
//市场推广 小程序
-(void)open_wXMiniMarketing;
//分享二维码到微信
-(void)share_WXpicWithImag:(UIImage *)image;

//分享微信小程序到详情页
-(void)share_WXMiniGoodsId:(NSString *)goodsId
                    traderId:(NSString *)traderId
                    goodsName:(NSString *)name
               description:(NSString *)description
                 thumImage:(NSString *)thumImage;
//分享微信小程序
-(void)share_WXMiniTraderId:(NSString *)traderId
                  goodsName:(NSString *)name
                description:(NSString *)description
                  thumImage:(NSString *)thumImage;
@end
